<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <script>
    var i = 1;
    var result = 0;
    do {
      if (i % 2 == 0) {
        result += i;
      }
      i++;
    } while (i <= 100)
    console.log('1~100的偶数的和为：' + result);
  </script>
</body>
</html>